﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using NCS.IConnect.ApplicationContexts;

namespace JM.JCY.SharePointComponent.LawArchives.LawCaseLeftMenu
{
    public partial class LawCaseLeftMenuUserControl : UserControl
    {
        protected string contextId
        {
            get
            {
                return ApplicationContext.Current.GetKeyValue("ContextId").ToString();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string sourceDirectory = this.Parent.AppRelativeTemplateSourceDirectory;    //Example:   ~/_CONTROLTEMPLATES/JM.OCP.SharePointComponent.Broadcast/CreateBroadcastsRole/
            string webPartName = sourceDirectory.Substring(sourceDirectory.TrimEnd('/').LastIndexOf('/') + 1).TrimEnd('/');

            switch (webPartName.ToLower())
            {
                case "accuse":
                case "accusedetails":
                    lbAccuse.CssClass = "leftmenuSelected";
                    break;

                case "citizencase":
                case "citizencasedetails":
                    lbCitizenCase.CssClass = "leftmenuSelected";
                    break;

                case "clue":
                case "cluedetails":
                    lbClue.CssClass = "leftmenuSelected";
                    break;
                case "crruption":
                case "crruptiondetails":
                    lbCrruption.CssClass = "leftmenuSelected";
                    break;

                case "investigate":
                case "investigatedetails":
                    lbInvestigate.CssClass = "leftmenuSelected";
                    break;

                case "lawcasematerial":
                case "lawcasematerialdetails":
                    lbLawCaseMaterial.CssClass = "leftmenuSelected";
                    break;
                case "lawcasequality":
                case "lawcasequalitydetails":
                    lbLawCaseQuality.CssClass = "leftmenuSelected";
                    break;

                case "lawcasesafety":
                case "lawcasesafetydetails":
                    lbCaseSafety.CssClass = "leftmenuSelected";
                    break;
                case "malpractice":
                case "malpracticedetails":
                    lbMalpractice.CssClass = "leftmenuSelected";
                    break;

                case "peoplesupervise":
                case "peoplesupervisedetails":
                    lbPeopleSupervise.CssClass = "leftmenuSelected";
                    break;

                case "publicprosecution":
                case "publicprosecutiondetails":
                    lbPublicProsecution.CssClass = "leftmenuSelected";
                    break;

                case "supervise":
                case "supervisedetails":
                    lbSupervise.CssClass = "leftmenuSelected";
                    break;

               
            }

            if (!IsPostBack)
            {
                //SetLeftMenuVisibility(pageName);
            }
        }
    }
}
